#include <limits.h>
#include "gtest/gtest.h"

#include "../include/WindowsTickSource.h"
#include "./subs/TickListenerSub.h"


// Tests factorial of negative numbers.
TEST(WindowTickSourceTest,ShoudHaveTick) {
	// This test is named "Negative", and belongs to the "FactorialTest"
	// test case.
	
	TickSource* tickSource=new WindowsTickSource();
	TickListenerSub* listener=new TickListenerSub();
    tickSource->SetListener(listener);
	int nTryCount=3;
	int nTickCount=listener->GetTickCount();
	while (nTryCount>0 && nTickCount==0)
	{
		nTickCount=listener->GetTickCount();
		nTryCount--;
		Sleep(1000);
	}
	
	EXPECT_TRUE(nTickCount>0);

}